package com.xty.itgroup.tech05tytex.Logic;

import com.xty.itgroup.tech05tytex.Databean.Bean02Customer;
import com.xty.itgroup.tech05tytex.Databean.Bean02CustomerTicket;
import com.xty.itgroup.tech05tytex.Mapper.Impl.Impl02Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class Logic02Customer {
    @Autowired
    private Impl02Customer customer;
    //1-添加客户
    public void addCustomer(Bean02Customer c){
        customer.addCustomer(c);
    }
    //2-添加客户开票信息
    public void addTicketInfo(Bean02CustomerTicket ct){
        customer.addCustomerTicket(ct);
    }
    public void updateCustomer(Bean02Customer c){
        customer.updateCustomer(c);
    }
    //3-简易查询
    public List<Map<String, Object>> simpleListCustomer(){
        return  customer.simpleListCustomer();
    }
    //4-完整查询 Map<String, List<Map<String, Object>>> glist = photos.stream().collect(Collectors.groupingBy(e -> e.get("record_code").toString()));
    public List<Bean02Customer> listCustomer(String customer_name,String customer_code,int customer_type){
       return customer.listCustomer(customer_name, customer_code, customer_type);
    }
    //5-开票信息列表
    public List<Bean02CustomerTicket> listCustomerTicket(int customer_id){
        return customer.listTicketInfo(customer_id);
    }
    //6-获取合同条款
    public Map<String,Object> getClause(int contract_id){
        return customer.getClause(contract_id);
    }

}
